home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / MWCC03 / EXAMPLES.ZIP / SFXWIN.PAS < prev   
Pascal/Delphi Source File  |  1993-08-18  |  5KB  |  163 lines

  1. {**********************************************************************}
  2. {*                                                                    *}
  3. {*          Microworks Sample Application                                        *}
  4. {*                                                                    *}
  5. {*         for Borland Pascal v7.0 and Turbo Pascal for Windows v1.5           *}
  6. {*                                                                    *}
  7. {*     Copyright 1992-93 Jeff Franks (Microworks) Sydney, Australia.  *}
  8. {*                                                                    *}
  9. {*         You are free to use, modify, reproduce and distribute the      *}
  10. {*         Sample Files (and/or any modified version) in any way you      *}
  11. {*         find useful.                                                                *}
  12. {*                                                                    *}
  13. {**********************************************************************}
  14.  
  15. {*** Introduction
  16.  
  17.     Application    := Basic SFX Window
  18.  
  19.     Files          := SFXWin.pas
  20.  
  21.     Units Required := MObjects and MWCC.dll
  22.  
  23.     Tabs           := 2
  24.  
  25.     Screen         := 800 * 600
  26.  
  27.     Date           := August, 1993.
  28.  
  29.     The TSFXWindow object does not support the use of standard menus (menu bars)
  30.     or TScroller scroll bars (ws_VScroll or ws_HScroll).
  31.  
  32.     Warning - Don't overide any inherited methods (not listed here) without first consulting
  33.               the documentation.
  34.  
  35. ***}
  36.  
  37. program SFXWin;
  38.  
  39. uses WinTypes, WinProcs, MObjects,
  40.          {$IFDEF Ver15}
  41.              WObjects;
  42.          {$ELSE}
  43.              Objects, OWindows, ODialogs;
  44.          {$ENDIF}
  45.  
  46. const
  47.  
  48.     AppName : PChar = 'NewSFXWindow';
  49.  
  50. type
  51.  
  52.     PNewSFXApplication = ^TNewSFXApplication;
  53.     TNewSFXApplication = object(TApplication)
  54.         procedure InitMainWindow; virtual;
  55.     end;
  56.  
  57.     PNewSFXWindow = ^TNewSFXWindow;
  58.     TNewSFXWindow = object(TSFXWindow)
  59.         constructor Init(AParent: PWindowsObject; AName: PChar);
  60.         destructor Done; virtual;
  61.         function  GetClassName : PChar; virtual;
  62.         procedure GetWindowClass(var AWndClass: TWndClass); virtual;
  63.         procedure SetUpWindow; virtual;
  64.         procedure WMPaint (var Msg: TMessage); virtual wm_First + wm_Paint;
  65.         procedure WMNCPaint (var Msg: TMessage); virtual wm_First + wm_NCPaint;
  66.         procedure WMNCCalcSize (var Msg: TMessage); virtual wm_First + wm_NCCalcSize;
  67.         procedure WMCtlColor (var Msg: TMessage); virtual wm_First + wm_CtlColor;
  68.         procedure WMActivate (var Msg: TMessage); virtual wm_First + wm_Activate;
  69.         procedure WMNCActivate (var Msg: TMessage); virtual wm_First + wm_NCActivate;
  70.         procedure WMActivateApp (var Msg: TMessage); virtual wm_First + wm_ActivateApp;
  71.         procedure WMGetMinMaxInfo (var Msg: TMessage); virtual wm_First + wm_GetMinMaxInfo;
  72.     end;
  73.  
  74. {********** TNewSFXApplication **********}
  75.  
  76. procedure TNewSFXApplication.InitMainWindow;
  77. begin
  78.     MainWindow := New(PNewSFXWindow, Init(nil, 'SpecialFX Window'));
  79. end;
  80.  
  81. {********** TNewSFXWindow **********}
  82.  
  83. constructor TNewSFXWindow.Init(AParent: PWindowsObject; AName: PChar);
  84. begin
  85.     TSFXWindow.Init(AParent, AName);
  86.     Attr.Style := Attr.Style;
  87.     Attr.X := GetSystemMetrics(sm_CXScreen) div 4;
  88.     Attr.Y := GetSystemMetrics(sm_CYScreen) div 4;
  89.     Attr.W := GetSystemMetrics(sm_CXScreen) div 2;
  90.     Attr.H := GetSystemMetrics(sm_CYScreen) div 2;
  91. end;
  92.  
  93. destructor TNewSFXWindow.Done;
  94. begin
  95.     TSFXWindow.Done;
  96. end;
  97.  
  98. function TNewSFXWindow.GetClassName;
  99. begin
  100.     GetClassName := AppName;
  101. end;
  102.  
  103. procedure TNewSFXWindow.GetWindowClass(var AWndClass: TWndClass);
  104. begin
  105.     TSFXWindow.GetWindowClass(AWndClass);
  106. end;
  107.  
  108. procedure TNewSFXWindow.SetUpWindow;
  109. begin
  110.     TSFXWindow.SetUpWindow;
  111. end;
  112.  
  113. procedure TNewSFXWindow.WMPaint (var Msg: TMessage);
  114. begin
  115.     TSFXWindow.WMPaint(Msg);
  116. end;
  117.  
  118. procedure TNewSFXWindow.WMNCPaint (var Msg: TMessage);
  119. begin
  120.     TSFXWindow.WMNCPaint(Msg);
  121. end;
  122.  
  123. procedure TNewSFXWindow.WMNCCalcSize (var Msg: TMessage);
  124. begin
  125.     TSFXWindow.WMNCCalcSize(Msg);
  126. end;
  127.  
  128. procedure TNewSFXWindow.WMCtlColor (var Msg: TMessage);
  129. begin
  130.     TSFXWindow.WMCtlColor(Msg);
  131. end;
  132.  
  133. procedure TNewSFXWindow.WMActivate (var Msg: TMessage);
  134. begin
  135.     TSFXWindow.WMActivate(Msg);
  136. end;
  137.  
  138. procedure TNewSFXWindow.WMNCActivate (var Msg: TMessage);
  139. begin
  140.     TSFXWindow.WMNCActivate(Msg);
  141. end;
  142.  
  143. procedure TNewSFXWindow.WMActivateApp (var Msg: TMessage);
  144. begin
  145.     TSFXWindow.WMNCActivate(Msg);
  146. end;
  147.  
  148. procedure TNewSFXWindow.WMGetMinMaxInfo (var Msg: TMessage);
  149. begin
  150.     TSFXWindow.WMGetMinMaxInfo(Msg);
  151. end;
  152.  
  153. {********** Main program **********}
  154.  
  155. var
  156.     SFXApp: TNewSFXApplication;
  157. begin
  158.  
  159.     SFXApp.Init(AppName);
  160.     SFXApp.Run;
  161.     SFXApp.Done;
  162. end.
  163.